package com.yuntian.service.Impl;

import com.yuntian.entity.SupplierMaster;
import com.yuntian.mapper.SupplierMasterMapper;
import com.yuntian.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 供应商服务实现类（MyBatis版）
 */
@Service
public class SupplierServiceImpl implements SupplierService {

    // 注入MyBatis mapper（原JPA repository已移除）
    private final SupplierMasterMapper supplierMapper;

    @Autowired  // 构造器注入mapper
    public SupplierServiceImpl(SupplierMasterMapper supplierMapper) {
        this.supplierMapper = supplierMapper;
    }

    @Override
    public List<SupplierMaster> getAllSuppliers() {
        // 调用MyBatis mapper方法（原JPA的findAll()替换为mapper.selectAll()）
        return supplierMapper.selectAll();
    }

    @Override
    public SupplierMaster getSupplierByCode(String supplierCode) {
        return null;
    }

    @Override
    public String selectNameByCode(String shiiresakiCode) {
return supplierMapper.selectNameByCode(shiiresakiCode);
    }
}